package com.binance.notification.api;

import java.util.List;
import java.util.Set;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import com.binance.master.configs.FeignConfig;
import com.binance.master.constant.Constant;
import com.binance.master.models.APIRequest;
import com.binance.master.models.APIRequest.VoidBody;
import com.binance.master.models.APIResponse;
import com.binance.notification.api.request.AliasTagsRequest;
import com.binance.notification.api.request.CountUidsByTagAndPlatformRequest;
import com.binance.notification.api.request.GetAliasDeviceListRequest;
import com.binance.notification.api.request.GetUidListByAliasAndPlatformRequest;
import com.binance.notification.api.request.GetWebSDKInitParamsRequest;
import com.binance.notification.api.request.SetAliasAndTagsRequest;
import com.binance.notification.api.request.SetLanguageRequest;
import com.binance.notification.api.response.AliasTagsResponse;
import com.binance.notification.api.response.WebSDKInitParamsResponse;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@FeignClient(name = Constant.NOTIFICATION_WEB_SERVICE, configuration = FeignConfig.class)
@Api(value = "操作极光“设备、标签、别名等的接口", tags = "操作极光“设备、标签、别名等的接口")
public interface DeviceApi {

    @ApiOperation(value = "获取所有已注册的终端的语言")
    @PostMapping("/jpush/device/languages")
    public APIResponse<Set<String>> languageTags(@RequestBody APIRequest<VoidBody> request);

    @ApiOperation(value = "获取某个设备的别名和标签")
    @PostMapping("/jpush/device/aliastags")
    public APIResponse<AliasTagsResponse> aliasTags(@RequestBody APIRequest<AliasTagsRequest> request);

    @ApiOperation(
            value = "设置某个设备的别名、标签。alias：别名，为空则表示清除该设备的别名（请一定要注意）；tagsToAdd：要添加的标签，多个以英文半角逗号隔开，可以为空；tagsToRemove：要删除的标签，多个以英文半角逗号隔开，可以为空；")
    @PostMapping("/jpush/device/setAliasAndTags")
    public APIResponse<AliasTagsResponse> setAliasAndTags(@RequestBody APIRequest<SetAliasAndTagsRequest> request);

    @ApiOperation(value = "获取Web平台初始化时所需要的信息。如果参数strValue为空，则系统会生产相应的值。")
    @PostMapping(value = "/jpush/device/web-sdk-initparams")
    public APIResponse<WebSDKInitParamsResponse> getWebSDKInitParams(
            @RequestBody APIRequest<GetWebSDKInitParamsRequest> request);

    @ApiOperation(value = "设置某个设备的语言")
    @PostMapping("/jpush/device/setlanguage")
    public APIResponse<Void> setLanguage(@RequestBody APIRequest<SetLanguageRequest> request);

    @ApiOperation(value = "获取某个别名所具有的设备列表")
    @PostMapping(value = "/jpush/device/devices")
    public APIResponse<List<String>> getAliasDeviceList(@RequestBody APIRequest<GetAliasDeviceListRequest> request);

    @ApiOperation(value = "获取某个指定平台中具有某个标签的所有的UID总数。")
    @PostMapping("/jpush/device/uidscount")
    public APIResponse<Long> countUidsByTagAndPlatform(
            @RequestBody APIRequest<CountUidsByTagAndPlatformRequest> request);

    @ApiOperation(value = "获取某个指定平台中具有指定别名的UID列表")
    @PostMapping(value = "/jpush/device/uids")
    public APIResponse<List<String>> getUidListByAliasAndPlatform(
            @RequestBody APIRequest<GetUidListByAliasAndPlatformRequest> request);
}
